using System.Reflection;

namespace SBPweb.Data
{

	/// <summary>
	/// This class accesses the name and the version of the executing assembly
	/// </summary>
    public class Version
	{

		#region Private static members

		private static string mName;
        private static System.Version mVersion;

		#endregion

		#region Constructor logic

		/// <summary>
		/// Fills private members on assembly load
		/// </summary>
		static Version()
        {
            Assembly asm = Assembly.GetExecutingAssembly();
            AssemblyName name = new AssemblyName(asm.FullName);
            mName = name.Name;
            mVersion = name.Version;
		}

		/// <summary>
		/// Prevents direct instantiation
		/// </summary>
		protected Version()
        {

		}

		#endregion

		#region Public static properties

		/// <summary>
		/// Returns the name of the executing assembly
		/// </summary>
		public static string Name
        {
            get
            {
                return mName;
            }
        }

		/// <summary>
		/// Returns the FileVersion of the executing assembly
		/// </summary>
        public static System.Version FileVersion
        {
            get
            {
                return mVersion;
            }
		}

		#endregion

	}
}
